<template>
	<div>
		<div id="app" class="wrapper wrapper-content">
			<div class="row">
				<div>
					<div class="panel panel-primary">
						<div class="panel-body" style="padding: 0px 120px; box-sizing: border-box;">
							<el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" :disabled="formReadOnly">
								<div style="text-align:center">
									<h3 style="font-weight: bold;color: black;font-size:24px">入职申请单</h3>
								</div>
								<table style="margin:0 auto;width:80%;margin-top:20px;border-collapse: collapse;margin-bottom:20px">
									<tr style="line-height: 3.5;">
										<td colspan="4"
											style="font-weight: bold;text-align: left;padding-left: 32px;position: relative;font-size: 14px">
											<img src="../../../../../assets/imgs/processManagement/work.png" alt=""
												style="position: absolute;width: 20px;height: 20px;left: 0px;top: 14px;margin-left: 8px">
											基本信息
										</td>
									</tr> 
									<tr class="iconHidden">
										<td class="width-15">申请人</td>
										<td class="width-30">
											<el-form-item  prop="applyuser.id" :rules="[{required: true, message:'申请人不能为空', trigger:'blur'}]">
												<user-select :limit='1' :value="inputForm.applyuser.id" @getValue='(value) => {inputForm.applyuser.id=value}'></user-select>
											</el-form-item>
										</td>
										<td class="width-15">所属公司</td>
										<td class="width-30">
											<el-form-item prop="company.id">
												<SelectTree ref="company" :props="{
											          value: 'id',             // ID字段名
											          label: 'name',         // 显示名称
											          children: 'children'    // 子级字段名
											        }" disabled url="/sys/office/treeData?type=2"
													:value="inputForm.company.id" :clearable="true" :accordion="true"
													@getValue="(value) => {inputForm.company.id=value}" />
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15">申请日期</td>
										<td class="width-30">
											<el-form-item label="" prop="applydate" :rules="[{required: true, message:'申请日期不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.applydate" placeholder="请填写申请日期"></el-input>
											</el-form-item>
										</td>
										<td class="width-15">所属部门</td>
										<td class="width-30">
											<el-form-item prop="depart.id">
												<SelectTree ref="depart" :props="{
											          value: 'id',             // ID字段名
											          label: 'name',         // 显示名称
											          children: 'children'    // 子级字段名
											        }" disabled url="/sys/office/treeData?type=2"
													:value="inputForm.depart.id" :clearable="true" :accordion="true"
													@getValue="(value) => {inputForm.depart.id=value}" />
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15"><span style="color: red">*&nbsp;</span>姓名</td>
										<td class="width-30">
											<el-form-item prop="name"
												:rules="[{required: true, message:'员工姓名不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.name"></el-input>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>性别</td>
										<td class="width-30">
											<el-form-item prop="sex"
												:rules="[{required: true, message:'员工性别不能为空', trigger:'blur'}]">
												<el-select v-model="inputForm.sex" placeholder="请选择"
													style="width: 100%;">
													<el-option v-for="item in $dictUtils.getDictList('sex')"
														:key="item.value" :label="item.label" :value="item.value">
													</el-option>
												</el-select>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15"><span style="color: red">*&nbsp;</span>电话</td>
										<td class="width-30">
											<el-form-item prop="phone"
												:rules="[{required: true, message:'员工电话不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.phone"></el-input>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>身份证号</td>
										<td class="width-30">
											<el-form-item prop="idcard"
												:rules="[{required: true, message:'身份证号不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.idcard"></el-input>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHiddens  errorMsg">
										<td class="width-15"><span style="color: red">*&nbsp;</span>岗位</td>
										<td class="width-30">
											<el-form-item prop="postname.id"
												:rules="[{required: true, message:'岗位不能为空', trigger:'blur'}]">
												<el-select v-model="inputForm.postname.id" placeholder="请选择"
													style="width: 100%">
													<el-option v-for="(item, index) in findPost" :label="item.name"
														:key="index" :value="item.id"></el-option>
												</el-select>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>角色</td>
										<td class="width-30">
											<el-form-item prop="roleId"
												:rules="[{required: true, message:'角色不能为空', trigger:'blur'}]">
												<el-select v-model="inputForm.roleIds" placeholder="请选择" multiple
													@change="addRoles" style="width: 100%">
													<el-option v-for="(item, index) in roleIdLists" :label="item.name"
														:key="index" :value="item.id"></el-option>
												</el-select>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15"><span style="color: red">*&nbsp;</span>登录名</td>
										<td class="width-30">
											<el-form-item prop="loginname"
												:rules="[{required: true, message:'登录名不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.loginname"></el-input>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>密码</td>
										<td class="width-30">
											<el-form-item prop="password"
												:rules="[{required: true, message:'密码不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.password"></el-input>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHiddens  errorMsg">
										<td class="width-15"><span style="color: red">*&nbsp;</span>归属公司</td>
										<td class="width-30">
											<el-form-item prop="companyId.id"
												:rules="[{required: true, message:'归属公司不能为空', trigger:'blur'}]">
												<el-select v-model="inputForm.companyId.id" placeholder="请选择"
													style="width: 100%">
													<el-option v-for="(item, index) in companys" :label="item.name"
														:key="index" :value="item.id"></el-option>
												</el-select>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>归属部门</td>
										<td class="width-30">
											<el-form-item prop="office.id"
												:rules="[{required: true, message:'归属部门不能为空', trigger:'blur'}]">
												<el-select v-model="inputForm.office.id" placeholder="请选择"
													style="width: 100%">
													<el-option v-for="(item, index) in offices" :label="item.name"
														:key="index" :value="item.id"></el-option>
												</el-select>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15"><span style="color: red">*&nbsp;</span>开户行</td>
										<td class="width-30">
											<el-form-item prop="bankofdeposit"
												:rules="[{required: true, message:'开户行不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.bankofdeposit"></el-input>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>行号</td>
										<td class="width-30">
											<el-form-item prop="banknumber"
												:rules="[{required: true, message:'行号不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.banknumber"></el-input>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15"><span style="color: red">*&nbsp;</span>银行账号</td>
										<td class="width-30">
											<el-form-item prop="bankaccount"
												:rules="[{required: true, message:'银行账号不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.bankaccount"></el-input>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>员工状态</td>
										<td class="width-30">
											<el-form-item prop="staffstatus"
												:rules="[{required: true, message:'员工状态不能为空', trigger:'blur'}]">
												<el-select v-model="inputForm.staffstatus" placeholder="请选择"
													style="width: 100%;">
													<el-option v-for="item in $dictUtils.getDictList('work_status')"
														:key="item.value" :label="item.label" :value="item.value">
													</el-option>
												</el-select>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15"><span style="color: red">*&nbsp;</span>合同形式</td>
										<td class="width-30">
											<el-form-item prop="contractform"
												:rules="[{required: true, message:'合同形式不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.contractform"></el-input>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>岗位绩效金额</td>
										<td class="width-30">
											<el-form-item prop="jobperformance"
												:rules="[{required: true, message:'岗位绩效金额不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.jobperformance"></el-input>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15"><span style="color: red">*&nbsp;</span>岗位工资</td>
										<td class="width-30">
											<el-form-item prop="postsalary"
												:rules="[{required: true, message:'岗位工资不能为空', trigger:'blur'}]">
												<el-input v-model="inputForm.postsalary"></el-input>
											</el-form-item>
										</td>
										<td class="width-15"><span style="color: red">*&nbsp;</span>到岗日期</td>
										<td class="width-30">
											<el-form-item prop="posttime"
												:rules="[{required: true, message:'到岗日期不能为空', trigger:'blur'}]">
												<el-date-picker v-model="inputForm.posttime" type="date"
													style="width: 100%;" value-format="yyyy-MM-dd" :clearable="false"
													placeholder="请选择">
												</el-date-picker>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15">身份证正面</td>
										<td class="width-30">
											<el-form-item label="" prop="idCardFrond" :rules="[]">
												<el-upload ref="idCardFrond" list-type="picture-card" :show-file-list="false"
													:action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl.oa.applyentry/oaApplyEntry`"
													:headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
													$alert(`<img style='width:100%' src=' ${(file.response && file.response.url) || file.url}'/>`,  {
													dangerouslyUseHTMLString: true,
													showConfirmButton: false,
													closeOnClickModal: true,
													customClass: 'showPic',
												});}" 
												:on-success="(response, file, fileList) => {
												inputForm.idCardFrond = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
											}" :on-remove="(file, fileList) => {
												$http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
												$message.success(data.msg)
											})
												inputForm.idCardFrond = fileList.map(item => item.url).join('|')
											}" :before-remove="(file, fileList) => {
												return $confirm(`确定移除 ${file.name}？`)
											}" multiple :limit="5" :on-exceed="(files, fileList) =>{
												$message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
											}" :file-list="idCardFrondArra">
													<img v-if="inputForm.idCardFrond" :src="inputForm.idCardFrond" style="width:100%">
													<i v-else class="el-icon-plus"></i>
												</el-upload>
											</el-form-item>
										</td>
										<td class="width-15">身份证背面</td>
										<td class="width-30">
											<el-form-item label="" prop="idCardBack" :rules="[]">
												<el-upload ref="idCardBack" list-type="picture-card" :show-file-list="false"
													:action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl.oa.applyentry/oaApplyEntry`"
													:headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
													$alert(`<img style='width:100%' src=' ${(file.response && file.response.url) || file.url}'/>`,  {
													dangerouslyUseHTMLString: true,
													showConfirmButton: false,
													closeOnClickModal: true,
													customClass: 'showPic'
												});
											}" :on-success="(response, file, fileList) => {
												inputForm.idCardBack = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
											}" :on-remove="(file, fileList) => {
												$http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
													$message.success(data.msg)
											})
												inputForm.idCardBack = fileList.map(item => item.url).join('|')
											}" :before-remove="(file, fileList) => {
												return $confirm(`确定移除 ${file.name}？`)
											}" multiple :limit="5" :on-exceed="(files, fileList) =>{
												$message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
											}" :file-list="idCardBackArra">
													<img v-if="inputForm.idCardBack" :src="inputForm.idCardBack" style="width:100%">
													<i class="el-icon-plus"></i>
												</el-upload>
											</el-form-item>
										</td>
									</tr>
									<tr class="iconHidden">
										<td class="width-15">毕业证</td>
										<td class="width-30">
											<el-form-item label="" prop="diploma" :rules="[]">
												<el-upload ref="diploma" list-type="picture-card"
													:action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl.oa.applyentry/oaApplyEntry`"
													:headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
													$alert(`<img style='width:100%' src=' ${(file.response && file.response.url) || file.url}'/>`,  {
													dangerouslyUseHTMLString: true,
													showConfirmButton: false,
													closeOnClickModal: true,
													customClass: 'showPic'
												});}" 
												:on-success="(response, file, fileList) => {
												inputForm.diploma = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
											}" :on-remove="(file, fileList) => {
												$http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
												$message.success(data.msg)
											})
												inputForm.diploma = fileList.map(item => item.url).join('|')
											}" :before-remove="(file, fileList) => {
												return $confirm(`确定移除 ${file.name}？`)
											}" multiple :limit="5" :on-exceed="(files, fileList) =>{
												$message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
											}" :file-list="diplomaArra">
													<i class="el-icon-plus"></i>
												</el-upload>
											</el-form-item>
										</td>
										<td class="width-15">学历证明</td>
										<td class="width-30">
											<el-form-item label="" prop="certificate" :rules="[]">
												<el-upload ref="certificate" list-type="picture-card"
													:action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl.oa.applyentry/oaApplyEntry`"
													:headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
													$alert(`<img style='width:100%' src=' ${(file.response && file.response.url) || file.url}'/>`,  {
													dangerouslyUseHTMLString: true,
													showConfirmButton: false,
													closeOnClickModal: true,
													customClass: 'showPic'
												});
											}" :on-success="(response, file, fileList) => {
												inputForm.certificate = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
											}" :on-remove="(file, fileList) => {
												$http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
													$message.success(data.msg)
											})
												inputForm.certificate = fileList.map(item => item.url).join('|')
											}" :before-remove="(file, fileList) => {
												return $confirm(`确定移除 ${file.name}？`)
											}" multiple :limit="5" :on-exceed="(files, fileList) =>{
												$message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
											}" :file-list="certificateArra">
													<i class="el-icon-plus"></i>
												</el-upload>
											</el-form-item>
										</td>
									</tr>
									<tr style="height: 80px;line-height: 80px">
										<td class="width-15 active" style="line-height: 80px">资格证
										</td>
										<td colspan="4" style="padding:0 10px">
											<el-form-item label="" prop="qualification" :rules="[]">
												<el-upload ref="qualification" list-type="picture-card"
													:action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl.oa.applyentry/oaApplyEntry`"
													:headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
													$alert(`<img style='width:100%' src=' ${(file.response && file.response.url) || file.url}'/>`,  {
													dangerouslyUseHTMLString: true,
													showConfirmButton: false,
													closeOnClickModal: true,
													customClass: 'showPic'
												});
											}" :on-success="(response, file, fileList) => {
												inputForm.qualification = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
											}" :on-remove="(file, fileList) => {
												$http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
												$message.success(data.msg)
											})
												inputForm.qualification = fileList.map(item => item.url).join('|')
											}" :before-remove="(file, fileList) => {
												return $confirm(`确定移除 ${file.name}？`)
											}" multiple :limit="5" :on-exceed="(files, fileList) =>{
												$message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
											}" :file-list="qualificationArra">
													<i class="el-icon-plus"></i>
												</el-upload>
											</el-form-item>
										</td>
									</tr>
									<tr style="height: 80px;line-height: 80px">
										<td class="width-15 active" style="line-height: 80px">备注信息
										</td>
										<td colspan="4" style="padding:0 10px">
											<el-form-item prop="remarks">
												<el-input v-model="inputForm.remarks"></el-input>
											</el-form-item>
										</td>
									</tr>
								</table>
							</el-form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import UserSelect from '@/components/userSelect'
	import SelectTree from '@/components/treeSelect/treeSelect.vue'
	import GridSelect from '@/components/gridSelect'
	import tableStyles from '../../../../../utils/mixins.js'
	export default {
		mixins: [tableStyles],
		data() {
			return {
				title: '',
				method: '',
				loading: false,
				idCardBackArra: [],
				diplomaArra: [],
				idCardFrondArra: [],
				certificateArra: [],
				qualificationArra: [],
				inputForm: {
					id: '',
					applyuser: {
						id: ''
					},
					company: {
						id: ''
					},
					applydate: '',
					depart: {
						id: ''
					},
					name: '',
					sex: '',
					phone: '',
					office: {
						id: ''
					},
					postname: {
						id: ''
					},
					roleId: '',
					loginname: '',
					password: '',
					bankofdeposit: '',
					banknumber: '',
					bankarea: '',
					bankaccount: '',
					staffstatus: '',
					contractform: '',
					jobperformance: '',
					postsalary: '',
					posttime: '',
					idcard: '',
					idCardFrond: '',
					idCardBack: '',
					qualification: '',
					remarks: '',
					diploma:'',
					certificate:'',
					companyId:{
						id: ""
					},
					userinfo:''
				},
				findPost: [], //岗位
				roleIdLists: [], //角色
				offices: [], //归属部门
				companys:[],//归属公司
			}
		},
		props: {
			businessId: {
				type: String,
				default: ''
			},
			formReadOnly: {
				type: Boolean,
				default: false
			}
		},
		components: {
			UserSelect,
			SelectTree,
			GridSelect
		},
		watch: {
			'businessId': {
				handler(newVal) {
					if (this.businessId) {
						this.init(this.businessId)
					} else {
						this.$nextTick(() => {
							this.$nextTick(() => {
								this.$refs.inputForm.resetFields();
								if (this.$store.state.user.id != '') {
									var users = this.$store.state.user
								} else {
									var users = JSON.parse(sessionStorage.getItem("userInfo"));
								}
								this.inputForm.applyuser.id = users.id;
								this.inputForm.company.id = users.company.id;
								this.inputForm.depart.id = users.office.id;
								this.inputForm.applydate = this.getNowTime();
								this.getRouters();
							})
						})
					}
				},
				immediate: true,
				deep: false
			}
		},
		mounted() {
			this.findPosts();
			this.getRole();
			this.departments();
			this.getCompanys();
			
		},
		methods: {
			getRouters(){
				console.log("this.$route.query",this.$route.query);
				this.inputForm.name=this.$route.query.realName;
				this.inputForm.sex=this.$route.query.sex;
				this.inputForm.phone=this.$route.query.phone;
				this.inputForm.idcard=this.$route.query.idCard;
				this.inputForm.userinfo=this.$route.query.userinfo;
				console.log("this.$route.query.name",this.inputForm.name);
			},
			init(id) {
				this.idCardFrondArra = []
				this.idCardBackArra = []
				this.qualificationArra = []
				if (id) {
					this.loading = true
					this.inputForm.id = id
					this.$nextTick(() => {
						this.$refs.inputForm.resetFields()
						this.$http({
							url: `/dlyrl/oa/applyentry/oaApplyEntry/queryById?id=${this.inputForm.id}`,
							method: 'get' 
						}).then(({
							data
						}) => {
							this.inputForm = this.recover(this.inputForm, data.oaApplyEntry)
							this.inputForm.roleIds=this.inputForm.roleId.split(',');
							this.inputForm.idCardFrond.split('|').forEach((item) => {
								if (item.trim().length > 0) {
									this.idCardFrondArra.push({
										name: decodeURIComponent(item.substring(item
											.lastIndexOf('/') + 1)),
										url: item
									})
								}
							})
							this.inputForm.diploma.split('|').forEach((item) => {
								if (item.trim().length > 0) {
									this.diplomaArra.push({
										name: decodeURIComponent(item.substring(item
											.lastIndexOf('/') + 1)),
										url: item
									})
								}
							})
							this.inputForm.certificate.split('|').forEach((item) => {
								if (item.trim().length > 0) {
									this.certificateArra.push({
										name: decodeURIComponent(item.substring(item
											.lastIndexOf('/') + 1)),
										url: item
									})
								}
							})
							this.inputForm.idCardBack.split('|').forEach((item) => {
								if (item.trim().length > 0) {
									this.idCardBackArra.push({
										name: decodeURIComponent(item.substring(item
											.lastIndexOf('/') + 1)),
										url: item
									})
								}
							})
							this.inputForm.qualification.split('|').forEach((item) => {
								if (item.trim().length > 0) {
									this.qualificationArra.push({
										name: decodeURIComponent(item.substring(item
											.lastIndexOf('/') + 1)),
										url: item
									})
								}
							})
							this.loading = false
						})
					})
				}
			},
			//岗位
			findPosts() {
				this.findPost = [];
				this.$http({
					url: "/sys/web/userinfo/findPost",
					method: "get",
					params: {},
				}).then(({
					data
				}) => {
					if (data) {
						this.findPost = data.post;
					}
				});
			},
			//角色
			getRole() {
				this.roleIdLists = [];
				this.$http({
					url: "/sys/web/userinfo/findRole",
					method: "get",
					params:{
						company:this.$store.state.user.companyId
					}
				}).then(({
					data
				}) => {
					if (data) {
						this.roleIdLists = data.role;
					}
				});
			},
			addRoles(e) {
				this.inputForm.roleIds = [];
				for (var i = 0; i < e.length; i++) {
					this.inputForm.roleIds.push(e[i])
				}
				this.inputForm.roleId = this.inputForm.roleIds.join(",");
			},
			//	归属公司
			getCompanys() {
				this.companys = [];
				this.$http({
					url: "/sys/web/userinfo/findCompany",
					method: "get",
					params: {
						id: this.$store.state.user.companyId
					},
				}).then(({
					data
				}) => {
					if (data) {
						this.companys = data.list;
					}
				});
			},
			//	归属部门
			departments() {
				this.offices = [];
				this.$http({
					url: "/sys/web/userinfo/findDepartemnt",
					method: "get",
					params: {
						id: this.$store.state.user.companyId
					},
				}).then(({
					data
				}) => {
					if (data) {
						this.offices = data.list;
					}
				});
			},
			// 表单提交
			saveForm(callback) {
				this.$refs['inputForm'].validate((valid) => {
					if (valid) {
						this.loading = true
						this.$http({
							url: `/dlyrl/oa/applyentry/oaApplyEntry/save`,
							method: 'post',
							data: {
								companyId: this.$store.state.user.companyId,
								...this.inputForm
							}
							
						}).then(({
							data
						}) => {
							if (data && data.success) {
								callback(data.businessTable, data.businessId)
							}
						})
					}
				})
			}
		}
	}
</script>
<style>
	.el-form-item__content{
		padding-left: 0px !important;
	}
</style>

